SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE VIEW dbo.[DnnProduct_vw_Profile]
AS
	SELECT     
		UP.UserID, 
		PD.PortalID, 
		PD.PropertyName, 
		CASE WHEN PropertyText IS NULL THEN PropertyValue ELSE PropertyText END AS PropertyValue, 
		UP.Visibility
	FROM dbo.DnnProduct_UserProfile AS UP 
		INNER JOIN dbo.DnnProduct_ProfilePropertyDefinition AS PD ON PD.PropertyDefinitionID = UP.PropertyDefinitionID
GO
